<?php get_header(); ?>

<div id="content">
  <?php if (have_posts()) : while (have_posts()) : the_post(); //print_r($post); ?>
  <p class="browse">
    <?php the_breadcrumb(); ?>
  </p>
  <?php the_title('<h2>', '</h2>'); ?>
  <p class="postmeta">Bởi
    <?php the_author_posts_link(); ?>
    vào ngày
    <?php the_time('M jS, Y') ?>
    
  </p>
  <div class="entry">
    <?php the_content('Chi tiết...'); ?>
<?php
  if( function_exists( 'attachments_get_attachments' ) )
  {
    $attachments = attachments_get_attachments();
    $total_attachments = count( $attachments );
    if( $total_attachments ) : ?>
	<div class="attachment">
	<h4>Tập tin đính kèm:</h4>
      <ul>
      <?php for( $i=0; $i<$total_attachments; $i++ ) : ?>
        <li><b><?php echo $attachments[$i]['title']; ?></b>&nbsp;&nbsp;<a href="<?php echo $attachments[$i]['location']; ?>" target="_blank">Tải về máy</a></li>
      <?php endfor; ?>
      </ul>
	</div>
    <?php endif; ?>
<?php } ?>
    <div class="clear"></div>
    <div class="tags">
      <?php the_tags('Từ khóa: ', ', ', ' '); ?>
      <?php edit_post_link('Chỉnh sửa', '[ ', ' ]'); ?>
    </div>
  </div>
  <!--end: entry-->
  <?php comments_template(); ?>
  <?php endwhile; else: ?>
  <?php endif; ?>
</div>
<!--end: content-->
<?php get_sidebar(); ?>
<?php get_footer(); ?>
